home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / fbm12s.lha / pic2fbm.c < prev    next >
C/C++ Source or Header  |  1994-07-18  |  2KB  |  60 lines

  1. /*****************************************************************
  2.  * pic2fbm.c: FBM Release 1.0 25-Feb-90 Michael Mauldin
  3.  *
  4.  * Copyright (C) 1989,1990 by Michael Mauldin.  Permission is granted
  5.  * to use this file in whole or in part for any purpose, educational,
  6.  * recreational or commercial, provided that this copyright notice
  7.  * is retained unchanged.  This software is available to all free of
  8.  * charge by anonymous FTP and in the UUNET archives.
  9.  *
  10.  * pic2fbm.c: convert a PIC bitmap to FBM format
  11.  *
  12.  * USAGE
  13.  *    % pic2fbm [ image.pic ] > image.fbm
  14.  *
  15.  * EDITLOG
  16.  *    LastEditDate = Mon Jun 25 00:30:43 1990 - Michael Mauldin
  17.  *    LastFileName = /usr2/mlm/src/misc/fbm/pic2fbm.c
  18.  *
  19.  * HISTORY
  20.  * 25-Jun-90  Michael Mauldin (mlm@cs.cmu.edu) Carnegie Mellon
  21.  *    Package for Release 1.0
  22.  *
  23.  * 03-May-89  Michael Mauldin (mlm) at Carnegie Mellon University
  24.  *    Beta release (version 0.93) mlm@cs.cmu.edu
  25.  *****************************************************************/
  26.  
  27. # include <stdio.h>
  28. # include <math.h>
  29. # include "fbm.h"
  30.  
  31. # define USAGE\
  32. "Usage: pic2fbm [ image.pic ] > image.fbm"
  33.  
  34. #ifndef lint
  35. static char *fbmid =
  36. "$FBM pic2fbm.c <1.0> 25-Jun-90  (C) 1989,1990 by Michael Mauldin, source \
  37. code available free from MLM@CS.CMU.EDU and from UUNET archives$";
  38. #endif
  39. main(argc,argv)
  40. int argc; char *argv[];
  41. { FBM image;
  42.  
  43.   /* Clear pointers */
  44.   image.cm = image.bm = (unsigned char *) NULL;
  45.  
  46.   /* Open input if given */
  47.   if (argc > 1)
  48.   { if (freopen (argv[1], "r", stdin) != stdin)
  49.     { perror (argv[1]);
  50.       exit(1);
  51.     }
  52.   }
  53.  
  54.   if (read_pic (&image, stdin, "", 0) &&
  55.        write_fbm (&image, stdout))
  56.   { exit(0); }
  57.   else
  58.   { exit (1); }
  59. }
  60.